function S = BandCharge(D,E,E_fine,KT)
Emin = E(1); Emax = E(end); he = E(2)-E(1);
N = length(E);
N_fine = length(E_fine);
S = zeros(1,N_fine);


sec_num = floor(N_fine/(1E4));
for i = 1:sec_num;
    E_extend = E'*ones(1,1E4);
    E_fine_extend = ones(N,1)*E_fine((i-1)*1E4+1:i*(1E4));
    f = 1./(1+exp((E_extend-E_fine_extend)/KT));
    S((i-1)*1E4+1:i*(1E4)) = D*f*he;
end

% E_extend = linspace(2*Emin, 2*Emax, 2*N_fine);
% n_start = 0.5*N_fine+1;
% n_end = 1.5*N_fine;
% n_projection = n_start:(N_fine/N):n_end;
% f = 1./(1+exp((E_extend)/KT));
% for i = 1:N_fine
%     f_shift = circshift(f,[0,-0.5*N_fine+i]);
%     S(i) = sum(f_shift(n_projection).*D)*he;
% end


end